Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resolves #2548 (there's still room for improvement, but it's enough to close that ticket for now I think).
In brief this PR:
transform
attr of every point on every mousemove to counteract the scale of trace group during pan/scroll. It turns out that can be extremely costly on graphs with many pts and even more costly for text nodes.plots/cartersian/dragbox.js
is now free of (potentially) slowselectAll
calls!hasSVG
,hasScattergl
and friends only on mousedown instead of on every mousemove.Taking https://plot.ly/~jackp/18395.embed to benchmark things:
before each mousedown interval took around 30-40ms:
off this branch we're down in around 1ms :
Note that this PR improves scroll performance a little as stashing shaves about 5ms per scroll interval, but is still pretty slow (we might have to wait for scattergl text there #2501).
cc @alexcjohnson @jackparmer